home *** CD-ROM | disk | FTP | other *** search
- Path: maverick.tad.eds.com!news-admin@tad.eds.com
- From: fignet05.darrins@eds.com (Darrin Smith)
- Newsgroups: comp.lang.c++
- Subject: A question about serialization and MFC in VC++.
- Date: 22 Mar 1996 21:35:12 GMT
- Organization: CUSD
- Message-ID: <4iv6eg$6qq@maverick.tad.eds.com>
- NNTP-Posting-Host: 148.94.222.53
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.11
-
- First off, thanks for reading.
-
- Now, how do you continue to read a document (file) until eof and use
- serialization?
-
- I have a serialize function in a class that looks like this:
-
- void MyClass::Serialize(CArchive& ar)
- {
- TRACE("Entering Graphics::Serialize\n");
- if (ar.IsStoring())
- {ar << x << y << rad1 << rad2 << type;
- }
- else
- {ar >> x >> y >> rad1 >> rad2 >> type;
- }
- }
-
- How do I call this function for each record in the file?
-
- I know I need to do something like:
-
- MyClass *ptr;
-
- ptr=new MyClass();
-
- ptr->Serialize();
-
- But this only gets the first record. I can't seem to get feof to work
- with the CArchive class (as in: while(!(feof(ar)) ).
-
- Any help is greatly appreciated.
-
- Thanks.
-
-